import {createRouter, createWebHistory } from 'vue-router'

// 静态路由
let staticRouters = [
    {
        path: '/',
        component: () => import('@/layouts/index.vue'),
        meta: {
            title: '首页',
            requireAuth: true,
            hidden: false,
            icon: "dataBoard",
        },
        redirect:"home",
        children: [
            {
                path: 'home',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: '首页',
                    requireAuth: true,
                    hidden: true,
                },
            },
        ],
    },
    {
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        meta: {
            title: '登录',
            hidden: true,
            icon: 'DocumentDelete',
        },
    },
]
//动态路由
let dynamicRouters =[]

const router = createRouter({
    history: createWebHistory(),
    routes:[...staticRouters,...dynamicRouters],
    scrollBehavior() {
        return {
            left: 0,
            top: 0,
        }
    },
})
export default router